import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.SplittableRandom;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by L.jp
 * Description:
 * User: 86189
 * Date: 2023-07-20
 * Time: 23:48
 */
public class Solution {
    public static Integer searchNum(List<Integer> list) {
        if (list == null || list.size() < 2) {
            return null;
        }
        Integer max = Collections.max(list);
        Integer second = null;
        for (Integer num : list) {
            if (num.equals(max)) {
                continue;
            }
            if (second == null || num > second) {
                second = num;
            }
        }
        return second;
    }
    
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(2);
        list.add(2);
        list.add(2);
        list.add(2);
        list.add(2);
        Integer second = searchNum(list);
        if (second != null) {
            System.out.println("second:" + second);
        } else {
            System.out.println("no second");
        }
    }
    
}